/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "ownerinstitution")
@NamedQueries({
    @NamedQuery(name = "Ownerinstitution.findAll", query = "SELECT o FROM Ownerinstitution o"),
    @NamedQuery(name = "Ownerinstitution.findByIdownerinstitution", query = "SELECT o FROM Ownerinstitution o WHERE o.idownerinstitution = :idownerinstitution"),
    @NamedQuery(name = "Ownerinstitution.findByOwnerinstitution", query = "SELECT o FROM Ownerinstitution o WHERE o.ownerinstitution = :ownerinstitution")})
public class Ownerinstitution implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idownerinstitution")
    private Integer idownerinstitution;
    @Column(name = "ownerinstitution")
    private String ownerinstitution;
    @OneToMany(mappedBy = "ownerinstitution", fetch = FetchType.LAZY)
    private List<Recordlevelelement> recordlevelelementList;

    public Ownerinstitution() {
    }

    public Ownerinstitution(Integer idownerinstitution) {
        this.idownerinstitution = idownerinstitution;
    }
     public Ownerinstitution(Integer idownerinstitution, String ownerinstitution) {
        this.idownerinstitution = idownerinstitution;
        this.ownerinstitution = ownerinstitution;
    }

    public Integer getIdownerinstitution() {
        return idownerinstitution;
    }

    public void setIdownerinstitution(Integer idownerinstitution) {
        this.idownerinstitution = idownerinstitution;
    }

    public String getOwnerinstitution() {
        return ownerinstitution;
    }

    public void setOwnerinstitution(String ownerinstitution) {
        this.ownerinstitution = ownerinstitution;
    }

    public List<Recordlevelelement> getRecordlevelelementList() {
        return recordlevelelementList;
    }

    public void setRecordlevelelementList(List<Recordlevelelement> recordlevelelementList) {
        this.recordlevelelementList = recordlevelelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idownerinstitution != null ? idownerinstitution.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ownerinstitution)) {
            return false;
        }
        Ownerinstitution other = (Ownerinstitution) object;
        if ((this.idownerinstitution == null && other.idownerinstitution != null) || (this.idownerinstitution != null && !this.idownerinstitution.equals(other.idownerinstitution))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Ownerinstitution[idownerinstitution=" + idownerinstitution + "]";
    }

}
